<template>
  <div class="box">
    <div class="back" @click="back"><van-icon name="arrow-left" /></div>

    <h2>最新精选商品</h2>

    <div class="img">
      <img v-lazy="getImageUrl('u256','png')" alt="" />
    </div>

    <div class="content">
      <h3>欧式花瓶</h3>
      <h3>享受一次欧皇的装饰~</h3>
      <p>给自己带来万分运气的瓶子。</p>
      <span>￥166.66</span>
    </div>

    <div class="bottom">
      <div>
        <h3>4.6</h3>
        <van-rate v-model="value" />
      </div>
      <div>
        <h3>10.3 <van-icon name="arrow" /></h3>
        <span>总销量/千</span>
      </div>
    </div>

    <div class="bj">背景</div>
  </div>
</template>

<script setup>
import { getImageUrl } from "@/uilts/index";
import { ref } from "vue";
import { useRouter } from "vue-router";

const router = useRouter();

const value = ref(4.5);
// 点击 放回上一页
function back() {
  router.back();
}
</script>

<style lang="less" scoped>
.box {
  height: 100%;
  // position: relative;
  .back {
    position: absolute;
    z-index: 99;
    width: 8.5vw;
    height: 8.5vw;
    margin-left: 3.733vw;
    margin-top: 4.667vw;
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    border-radius: 50%;
    margin-bottom: 4.533vw;
  }
  h2 {
    position: absolute;
    width: 5.6vw;
    height: 30vw;
    z-index: 99;
    font-size: 1.6vw;
    font-weight: 800;
    left: 5.5vw;
    top: 18vw;
    text-align: center;
  }
  .img {
    width: 78vw;
    height: 78vw;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 40vw;
    z-index: 88;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .content {
    position: absolute;
    width: 90%;
    height: 30vw;
    z-index: 99;
    top: 110vw;
    left: 5.5vw;
    h3 {
      font-size: 5vw;
      line-height: 1;
      margin-bottom: 2vw;
      font-weight: 700;
    }
    p {
      font-size: 1.6vw;
      line-height: 1;
      margin-bottom: 5.667vw;
    }
    span {
      font-size: 1.6vw;
      font-weight: 700;
    }
  }
  .bottom {
    width: 88%;
    height: 20vw;
    position: absolute;
    bottom: 10vw;
    left: 5.5vw;
    display: flex;
    justify-content: space-between;
    h3 {
      line-height: 1;
      font-size: 8vw;
      font-weight: 600;
      margin-bottom: 1.333vw;
      display: flex;
      align-items: center;
      :deep(.van-icon) {
        font-size: 4.5vw;
        font-weight: 600;
        margin-left: 1.333vw;
      }
    }
    span {
      font-size: 12px;
      font-weight: 600;
    }
    :deep(.van-rate__icon--full) {
      color: #000;
      font-size: 2vw;
      margin-right: 1vw;
    }
  }
  :deep(.van-rate__icon) {
    color: #fff;
    font-size: 2vw;
    margin-right: 1vw;
  }
  .bj {
    height: 50%;
    width: 120%;
    background-color: rgb(113, 154, 163);
    transform: rotate(-8deg);
    transform-origin: 0 100%;
  }
}
</style>
